package com.whmall.service.crm.provider;

import com.whmall.component.entity.dto.PageReqDTO;
import com.whmall.component.entity.dto.PageRspDTO;
import com.whmall.service.crm.api.SupplierCreditScoreApi;
import com.whmall.service.crm.entity.dto.suppliercreditscore.*;
import com.whmall.service.crm.module.suppliercreditscore.service.SupplierCreditScoreService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;

/**
 * Author：yangdong
 * Date：2020/12/12
 * Description：
 */
@Service(interfaceClass = SupplierCreditScoreApi.class)
public class SupplierCreditScoreProvider implements SupplierCreditScoreApi {

    @Autowired
    private SupplierCreditScoreService scoreService;

    @Override
    public PageRspDTO<SupplierCreditScoreRspDTO> page(PageReqDTO pageReqDTO, SupplierCreditScoreQueryReqDTO queryReqDTO) {
        return scoreService.page(pageReqDTO, queryReqDTO);
    }

    @Override
    public PageRspDTO<SupplierCreditScoreChangeHistoryRspDTO> changeHistoryPage(Long id, PageReqDTO pageReqDTO, SupplierCreditScoreChangeHistoryQueryReqDTO queryReqDTO) {
        return scoreService.changeHistoryPage(id, pageReqDTO, queryReqDTO);
    }

    @Override
    public void scoreChange(Long id, SupplierCreditScoreChangeHistoryCreateReqDTO reqDTO) {
        scoreService.scoreChange(id, reqDTO);
    }

    @Override
    public void resetProblemCount(Long id) {
        scoreService.resetProblemCount(id);
    }

    @Override
    public Map<Long, SupplierCreditScoreImportantFieldRspDTO> listByIds(List<Long> ids) {
        return scoreService.listByIds(ids);
    }
}
